﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using CYTS.Aoyou.Framework.Config;

namespace CYTS.Aoyou.Framework.Cache
{
    /// <summary>
    /// 缓存提供者配置类
    /// </summary>
    public class CacheProviderConfig : ConfigUnit
    {
        public List<CacheProvider> CacheProviders { get; set; }
    }

    /// <summary>
    /// 缓存提供者配置
    /// </summary>
    public class CacheProvider
    {
        [XmlAttribute(AttributeName = "category")]
        public CacheCategory Category { get; set; }

        public List<CacheConnection> CacheConnections { get; set; }
    }

    /// <summary>
    /// 缓存连接配置
    /// </summary>
    public class CacheConnection
    {
        [XmlAttribute(AttributeName = "name")]
        public string Name { get; set; }

        [XmlAttribute(AttributeName = "host")]
        public string Host { get; set; }

        [XmlAttribute(AttributeName = "port")]
        public int Port { get; set; }

        [XmlAttribute(AttributeName = "regionName")]
        public string RegionName { get; set; }

        [XmlAttribute(AttributeName = "password")]
        public string Password { get; set; }

        [XmlAttribute(AttributeName = "readOnly")]
        public bool ReadOnly { get; set; }
    }
}
